package com.work.order.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author qinminghui
 * @description TODO
 * @date 21 17:24
 */
@RestController
public class SessionController {
    @Autowired
    private HttpServletRequest request;

    @RequestMapping("/session/{id}")
    public String session(@PathVariable("id") String id) {
        request.getSession().setAttribute("tenant", id);
        return "success";
    }
}
